// 根据权限列表获取树形菜单和按钮权限
export const getTreeMenuButtonList = (result: any) => {
  let newArray: any[] = []
  let menuArray: any[] = []
  let buttonArray: any[] = []
  result.forEach((item: any) => {
    if (item.type == '3') {
      buttonArray.push(item)
    } else {
      newArray.push(item)
    }
  })
  newArray.forEach((item: any) => {
    item.children = newArray.filter((v: any) => v.superior === item.code)
    if (item.superior === '') menuArray.push(item)
  })

  return { menuArray, buttonArray }
}
